package main

import (
	"encoding/csv"
	"fmt"
	"log"
	"os"
)

func main()  {
	file, err := os.Open("./cmd/a/2.csv")  //读取文件
	if err != nil {
		fmt.Println(err)
	}

	defer file.Close()

	reader := csv.NewReader(file)
	reader.FieldsPerRecord = -1
	csvdata, err := reader.ReadAll()   //读取全部数据
	// fmt.Println(csvdata)
	var ids []string
	var str string
	for _, line := range csvdata {    //按行打印数据
		ids = append(ids, line[0])
		str = str + "," + line[0]
	}
	log.Println(ids)
	log.Println(str)
}
